package com.xmy.cultivate.controller;

import com.xmy.cultivate.entity.BookStudent;
import com.xmy.cultivate.service.IBookStudentService;
import com.xmy.cultivate.util.Code;
import com.xmy.cultivate.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 订购学生 前端控制器
 * </p>
 *
 * @author hpiggy
 * @since 2025-01-04
 */
@RestController
@RequestMapping("/api/bookStudent")
@Scope("prototype")
public class BookStudentController extends BaseController{

    @Autowired
    IBookStudentService iBookStudentService;


    @PostMapping("/getBookForStudentId")
    public Result getBookForStudentId(@RequestParam("file") MultipartFile upload, HttpServletRequest request,
                                      @RequestParam(value = "schoolId",required = false) Long schoolId,
                                      @RequestParam(value = "subjectsId",required = false) String subjectsId,
                                      @RequestParam(value = "adminId",required = false) Long adminIdParam){
        //List<BookStudent> bookStudentList = iBookStudentService.getBookForStudentId();
        //return new Result(Code.OK,bookStudentList,"");
        return null;
    }

    /**
     * 发放
     * @param bookStudent
     * @return
     */
    @PostMapping("/grantBookForStudent")
    public Result grantBookForStudent(@RequestBody BookStudent bookStudent){
        //Result rs = iBookStudentService.grantBookForStudent(bookStudent);
        //return rs;
        return null;
    }
}
